[8]
Example Initialization Program
/*******************************************************************************
* Function Name : UILCD_Init
* Description : Initializes LCD.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void TFT_7_Init(void)
{
GPIO_ResetBits(GPIOC, CS1);
GPIO_SetBits(GPIOC, nRD);
GPIO_ResetBits(GPIOC, nWR);
GPIO_WriteBit(GPIOC, RES, Bit_RESET);
TFT_delay(5);
GPIO_WriteBit(GPIOC, RES, Bit_SET);
TFT_delay(100);
TFT_7_Write_Command(0x01); //Software Reset
TFT_7_Write_Command(0x01);
TFT_7_Write_Command(0x01);
TFT_delay(10);
TFT_7_Command_Write(0xe0,0x01); //START PLL
TFT_7_Command_Write(0xe0,0x03); //LOCK PLL
TFT_7_Write_Command(0xb0);
//SET LCD MODE SET TFT 18Bits MODE
GPIO_SetBits(GPIOC, RS);
TFT_7_Write_Data(0x08);
//SET TFT MODE & hsync+Vsync+DEN MOD
E
TFT_7_Write_Data(0x80);
//SET TFT MODE & hsync+Vsync+DEN MOD
E
TFT_7_Write_Data(0x03);
//SET horizontal size=800-1 HightBy
te
TFT_7_Write_Data(0x1f);
//SET horizontal size=800-1 LowByte
TFT_7_Write_Data(0x01);
//SET vertical size=480-1 HightByte
TFT_7_Write_Data(0xdf);
//SET vertical size=480-1 LowByte
TFT_7_Write_Data(0x00);
//SET even/odd line RGB seq.=RGB
TFT_7_Command_Write(0xf0,0x00); //SET pixel data I/F format=8bit
TFT_7_Command_Write(0x36,0x09); //SET address mode=flip vertical, BGR
TFT_7_Command_Write(0x3a,0x60); // SET R G B format = 6 6 6
TFT_7_Write_Command(0xe2);
//SET PLL freq=113.33MHz
GPIO_SetBits(GPIOC, RS);
TFT_7_Write_Data(0x22);
TFT_7_Write_Data(0x03);
TFT_7_Write_Data(0x04);
TFT_7_Write_Command(0xe6);
//SET PCLK freq=33.26MHz
GPIO_SetBits(GPIOC, RS);
TFT_7_Write_Data(0x02);
TFT_7_Write_Data(0xff);
TFT_7_Write_Data(0xff);
TFT_7_Write_Command(0xb4);
//SET HBP,
GPIO_SetBits(GPIOC, RS);
TFT_7_Write_Data(0x03);
//SET HSYNC Total
TFT_7_Write_Data(0xef);
TFT_7_Write_Data(0x00);
//SET HBP
TFT_7_Write_Data(0xa3);
TFT_7_Write_Data(0x07);
//SET VBP
TFT_7_Write_Data(0x00);
//SET Hsync pulse start position
TFT_7_Write_Data(0x00);